package com.saikei.demoapp.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Upsert

@Dao
interface UserDao {

    @Insert
    fun insert(user: User):Long

    @Upsert
    fun upsert(user: User):Long

    @Query("Delete From user where userId = :userId")
    fun delete(userId:Int):Int

    @Query("Select * From user where userId = :userId")
    fun findUserFormId(userId:Int):User

    @Query("Select * From user")
    fun findAll():List<User>

}